package com.dizner.diassistant.database

import android.content.Context
import androidx.sqlite.db.SupportSQLiteOpenHelper
import com.dizner.diassistant.dataentry.BloodPressureHistoryEntry
import android.icu.lang.UCharacter.GraphemeClusterBreak.V
import androidx.room.*
import com.dizner.diassistant.App
import com.dizner.diassistant.datadao.BloodPressureHistoryDao


@Database(entities = [BloodPressureHistoryEntry::class], version = 1)
public abstract class AppDatabase : RoomDatabase() {

    public companion object {
        public fun getInstance(context: Context): AppDatabase {
            return Room.databaseBuilder(context, AppDatabase::class.java, "Di_database.db").build()
        }
    }


    private object Single {

        val sin: AppDatabase = Room.databaseBuilder(
            App.instance(),
            AppDatabase::class.java,
            "Di_database.db"
        )
            .allowMainThreadQueries()
            .build()
    }

    public abstract fun getHistoryDao(): BloodPressureHistoryDao
}